package com.lzh.persevere.model.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.lzh.persevere.common.BaseEntity;
import lombok.*;
import lombok.experimental.Accessors;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;

/**
 * 照片表(Photo)表实体类
 *
 * @author luzhiheng
 * @since 2025-07-05
 */
@EqualsAndHashCode(callSuper = true)
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("photo")
@Builder
@Accessors(chain = true)
@Entity
@Table(name = "photo", indexes = {})
public class Photo extends BaseEntity {

    /**
     * 照片名
     */
    @Column(name = "photo_name", columnDefinition = "varchar(255) COMMENT '照片名称'")
    private String photoName;

    /**
     * 标签ID
     */
    @Column(name = "tag_id", columnDefinition = "bigint(20) COMMENT '标签ID'")
    private Long tagId;

    /**
     * 照片地址
     */
    @Column(name = "url", columnDefinition = "varchar(2048) COMMENT '照片地址'")
    private String url;

    /**
     * 照片拍摄时间
     */
    @JsonFormat (pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @Column(name = "take_time", columnDefinition = "datetime COMMENT '照片拍摄时间'")
    private Date takeTime;
}
